# Compiler is G++
CXX = g++


#directory
ROOTDIR      = ./
BASICLIBDIR  = BasicLib
EXAMPLE      = example
CHAT         = $(EXAMPLE)/chat_room/

# libraries
LIBS = -Llib/ -lsocker
LIB  = libsocker.a

# flags
CFLAGS = -Iinclude -I$(ROOTDIR)

.PHONY: lib example clean

lib: $(wildcard *.cpp)
	$(CXX) $(CFLAGS) *.cpp -c;
	$(CXX) $(CFLAGS) $(BASICLIBDIR)/*.cpp -c;
	ar -rc -o $(LIB) *.o;
	mv $(LIB) ./lib/

example: $(wildcard *.cpp)
	$(CXX) $(CFLAGS) $(CHAT)/*.cpp $(LIBS) -o bin/chat_server ;

clean:
	rm -f *.o